﻿using System.Collections.Generic;
using System.Linq;

namespace TestSystem.Model.Data.Repositories
{
    public class FrequencyTypesRepository
    {
        private TestSystemEntities entities = new TestSystemEntities();

        public IEnumerable<FrequencyType> FindAll()
        {
            return entities.FrequencyTypes.AsQueryable();
        }
        public int GetFrequencyId (string name)
        {
            var result = entities.FrequencyTypes.Single(t => t.Name == name);
            return result.Id;
        }

        public void Insert(int ToolId)
        {
            
        }

        public void Save()
        {
            entities.SaveChanges();
        }
    }
}
